//
//  headView.m
//  ZhiBoYuan
//
//  Created by apple on 2018/4/22.
//  Copyright © 2018年 apple. All rights reserved.
//

#import "headView.h"

@implementation headView

- (id)initWithFrame:(CGRect)frame{
    
    self=[super initWithFrame:frame];
    
    if (self)
    {
         [self addSubview:self.titleLabel];
        [self addSubview:self.button];
    }
    return self;
}

-(UIButton *)button{
    if (!_button) {
        _button = [UIButton buttonWithType:(UIButtonTypeCustom)];
        
        [_button setTitle:@"全部" forState:(UIControlStateNormal)];
        
        [_button setImage:[UIImage imageNamed:@"箭头-4"] forState:(UIControlStateNormal)];
        
        [_button setTitleColor:hui3Color forState:(UIControlStateNormal)];
        
        [_button setTitleEdgeInsets:(UIEdgeInsetsMake(0, 0, 0, 50))];
        
        [_button setImageEdgeInsets:(UIEdgeInsetsMake(0, 50, 0, 0))];
        
        [_button.titleLabel setFont:[UIFont systemFontOfSize:16]];
        
        _button.frame = CGRectMake(ScreenWidth-120, 0, 100, self.frame.size.height);
    }
    return _button;
}


-(UILabel *)titleLabel{
    if (!_titleLabel) {
        _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 0,80, self.frame.size.height)];
        
        _titleLabel.textColor = hui5Color;
    }
    return _titleLabel;
}

-(void)setHearderTitle:(NSString *)title{
    
    _titleLabel.text=title;
    
}
@end
